﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;

namespace Vistas
{
    /// <summary>
    /// Lógica de interacción para VehiculosEnPlaya.xaml
    /// </summary>
    public partial class VehiculosEnPlaya : Window
    {
        public VehiculosEnPlaya()
        {
            InitializeComponent();
        }

        private void button11_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void Sector_Click(object sender, RoutedEventArgs e)
        {
            ToggleButton TB = (ToggleButton)sender; 
            Border B = (Border)TB.Content;
            if (B.Background == Brushes.Green)
            {
                MessageBox.Show("Sector Disponible. Registrar Entrada.");
               // B.Background = Brushes.Red;

            }
            else
            {

                if (B.Background == Brushes.Red)
                {
                    MessageBox.Show("Sector Ocupado. Registrar Salida.");
                   // B.Background = Brushes.Green;

                }
                else
                {
                    if (B.Background == Brushes.DarkGray)
                    {
                        MessageBox.Show("Sector deshabilitado.");

                    }
                }
            }
      
        }



        private void Window_Loaded(object sender, RoutedEventArgs e)
        {

            b7.Background = Brushes.Red;
            // Valores que podrán ser leidos desde la BD
            //string fila = "B", asiento = "3";

            //string butaca = fila + asiento;
            //ToggleButton TB = FindName(butaca) as ToggleButton;
            //if (TB != null)
            //{
            //    TB.IsEnabled = true;
            //    Border B = (Border)TB.Content;
            //    B.Background = Brushes.Red;

            //}

        }
    }
}
